package com.example.kudesoft.domain;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import javax.persistence.*;
import java.io.Serializable;

/*
* 声明实体类
* 实体类如果转成json时，如果有空属性，让它忽略掉
* */
@Entity
@JsonIgnoreProperties
public class Students extends BaseEntity implements Serializable ,Cloneable {
    @Override
    public String toString() {
        return "Students{" +
                "sid=" + sid +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", birthday='" + birthday + '\'' +
                '}';
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
//主键自动生成

    private int  sid;
    @Column (length = 20)//如果不指定长度，将默认为最大值，会浪费资源空间
    private String name;
    @Column(length = 2)
    private String gender;
    @Column (length = 20)
    private String birthday;//日期必须使用String ，方便格式转换

    public Students() {
    }

    public Students(int sid, String name, String gender, String birthday) {
        this.sid = sid;
        this.name = name;
        this.gender = gender;
        this.birthday = birthday;
    }

    public int getSid() {
        return sid;
    }

    public void setSid(int sid) {
        this.sid = sid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }
}
